package cn.aspart.aspectj;

import cn.aspart.aspectj.pojo.Order;
import cn.aspart.aspectj.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.math.BigDecimal;

@SpringBootApplication
public class AspectjApplication implements CommandLineRunner {

	public static void main(String[] args) {
		SpringApplication.run(AspectjApplication.class, args);
	}

	@Autowired
	private OrderService orderService;

	@Override
	public void run(String... args) throws Exception {
		Order order = new Order();
		order.setId(1L);
		order.setOrderNo("6669183475664");
		order.setOrderAmount(BigDecimal.ONE);
		orderService.addOrder(order);
	}
}
